<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Register</title>
    <!-- 引入Bootstrap和Bootswatch的Cosmo主题 -->
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f3f3f3;  /* Light grey background for the entire page */
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Microsoft font styles */
        }
        .container {
            max-width: 600px; /* Limit the maximum width for better readability */
            margin: auto;
            padding: 20px;
            background-color: #ffffff; /* White background for the container */
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        h2 {
            color: #0078d7; /* Microsoft blue for the headings */
        }
        .form-group label {
            color: #333; /* Darker grey for the labels */
        }
        .form-control {
            border-radius: 4px;
            border: 1px solid #ccc;
        }
        .btn-primary {
            background-color: #0078d7;
            border-color: #0078d7;
        }
        .btn-primary:hover {
            background-color: #005a9e;
            border-color: #005a9e;
        }
        .alert {
            border-radius: 4px;
            margin-top: 10px;
        }
    </style>
</head>
<body>
    <div class="container mt-5">
        <h2>管理员快速注册通道</h2>
        <form method="POST" action="">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" class="form-control" id="username" name="username" value="{{ request.form.username }}">
                {% for error in form.username.errors %}
                <div class="alert alert-danger">{{ error }}</div>
                {% endfor %}
            </div>
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" class="form-control" id="password" name="password">
                {% for error in form.password.errors %}
                <div class="alert alert-danger">{{ error }}</div>
                {% endfor %}
            </div>
            <div class="form-group">
                <label for="confirm">确认密码</label>
                <input type="password" class="form-control" id="confirm" name="confirm">
                {% for error in form.confirm.errors %}
                <div class="alert alert-danger">{{ error }}</div>
                {% endfor %}
            </div>
            <button type="submit" class="btn btn-primary">注册账号</button>
        </form>
        {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
            {% for category, message in messages %}
            <div class="alert alert-{{ category }}">{{ message }}</div>
            {% endfor %}
        {% endif %}
        {% endwith %}
    </div>
</body>
</html>